package kz.pompei.ifacer.model;

public class CursorInfo {
  public final CursorKind kind;
  public final String params;
  
  public CursorInfo(CursorKind kind, String params) {
    this.kind = kind;
    this.params = params;
  }
  
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((kind == null) ? 0 : kind.hashCode());
    result = prime * result + ((params == null) ? 0 : params.hashCode());
    return result;
  }
  
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    CursorInfo other = (CursorInfo)obj;
    if (kind != other.kind) return false;
    if (params == null) {
      if (other.params != null) return false;
    } else if (!params.equals(other.params)) return false;
    return true;
  }
  
  public String display() {
    return kind.name() + ", " + params;
  }
}
